package com.huaxin.hxmoduleworkorder.dto.response;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.huaxin.hxmoduleworkorder.common.enums.CustomerType;
import com.huaxin.hxmoduleworkorder.common.enums.InspectionOrderItemResultStatus;
import com.huaxin.hxmoduleworkorder.common.enums.InspectionTemplateItemType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

@Data
public class InspectionReportOrderItemDTO {

    @Schema(description = "唯一ID（UUID）- 主键", example = "ins_order_item_001")
    private String id;

    @Schema(description = "自增序列号（唯一索引，非主键）", example = "1")
    private Integer autoId;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createdAt;

    @Schema(description = "创建人", example = "admin")
    private String createdBy;

    @Schema(description = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updatedAt;

    @Schema(description = "更新人", example = "admin")
    private String updatedBy;

    @Schema(description = "是否删除（0:未删, 1:已删）", example = "0")
    private Integer isDeleted = 0;

    @Schema(description = "删除时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime deletedAt;

    @Schema(description = "删除人", example = "admin")
    private String deletedBy;

    @Schema(description = "所属巡查工单ID", example = "ins_order_001")
    private String inspectionOrderId;

    @Schema(description = "客户类型：commercial/residential", example = "commercial")
    private CustomerType customerType;

    @Schema(description = "客户ID", example = "cust_001")
    private String customerId;

    @Schema(description = "所属配电房ID", example = "room_001")
    private String roomId;

    @Schema(description = "所属配电箱ID", example = "cab_001")
    private String cabinetId;

    @Schema(description = "名称", example = "电表读数是否正常")
    private String name;

    @Schema(description = "类型：check/measure/photo", example = "photo")
    private InspectionTemplateItemType type;

    @Schema(description = "标准值", example = "220V±5%")
    private String standardValue;

    @Schema(description = "检查结果状态：pending/normal/abnormal", example = "pending")
    private InspectionOrderItemResultStatus resultStatus;

    @Schema(description = "实际值（填写或拍照路径）", example = "218V")
    private String actualValue;

    @Schema(description = "备注或问题描述", example = "电压偏低，建议检查线路")
    private String remarks;

    @Schema(description = "照片URL列表", example = "[\"https://oss/1.jpg\",\"https://oss/2.jpg\"]")
    private List<String> photoUrls;

    @Schema(description = "排序", example = "1")
    private Integer sequence;
}

